<?php
$arr=[
    ['id'=>1,'name'=>'张三','number'=>2,'date'=>'2020/4/1'],
    ['id'=>2,'name'=>'李四','number'=>3,'date'=>'2020/4/1'],
    ['id'=>3,'name'=>'王五','number'=>1,'date'=>'2020/4/1'],
    ['id'=>4,'name'=>'张三','number'=>5,'date'=>'2020/4/2'],
    ['id'=>5,'name'=>'赵六','number'=>3,'date'=>'2020/4/2'],
    ['id'=>6,'name'=>'李四','number'=>6,'date'=>'2020/4/3'],
    ['id'=>7,'name'=>'小明','number'=>4,'date'=>'2020/4/3'],
    ['id'=>8,'name'=>'小红','number'=>3,'date'=>'2020/4/3'],
    ['id'=>9,'name'=>'王五','number'=>6,'date'=>'2020/4/4'],
    ['id'=>10,'name'=>'张三','number'=>3,'date'=>'2020/4/5']
];
$date=[];
foreach ($arr as $value){
     $km=0;
     foreach ($date as $valueDate){
          if($value['date'] == $valueDate){
                $km=1;
                break;
          }
     }
     if($km==0){
         $date[]=$value['date'];
     }
}
$content=[];
$number=[];
foreach ($arr as $value){
    $ka=0;
      foreach ($content as $valueContent){
             if(isset($valueContent['name'])){
                  if($value['name'] == $valueContent['name']){
                       $ka=1;
                  }
             }
      }
      if($ka==0){
            foreach ($date as $valueDate){
                $kb=0;
                  foreach($arr as $valueArr){
                      if($valueArr['name']==$value['name']){
                              if($valueArr['date'] == $valueDate){
                                  $number[]=$valueArr['number'];
                                  $kb=1;
                              }
                      }
                  }
                  if($kb==0){
                      $number[]='""';
                  }
            }
          $content[]=[
            'name'=>$value['name'],
              'number'=>$number,
          ];
            $number=[];
      }
}
$la=['date'=>$date,'content'=>$content];
echo '<pre>';
 print_r($la);
echo '</pre>';